package sg.edu.nus.iss.jass.controller;

import sg.edu.nus.iss.jass.gui.MainFrame;

public class MainController {

	private static MainController instance;

	private JobSeekerController jobSeekerController = null;

	private JobSearchController jobSearchController = null;

	private JobAdvertisementController jobAdvertisementController = null;

	private MainFrame mainframe = null;

	static {
		instance = new MainController();
	}

	private MainController() {

	}

	public void init(MainFrame mainFrame) {
		mainframe = mainFrame;
		jobSeekerController = new JobSeekerController();
		jobSearchController = new JobSearchController();
		jobAdvertisementController = new JobAdvertisementController();
	}

	/**
	 * @return the jobSeekerController
	 */
	public JobSeekerController getJobSeekerController() {

		return jobSeekerController;
	}

	/**
	 * @param jobSeekerController the jobSeekerController to set
	 */
	public void setJobSeekerController(JobSeekerController jobSeekerController) {

		this.jobSeekerController = jobSeekerController;
	}

	/**
	 * @return the jobSearchController
	 */
	public JobSearchController getJobSearchController() {

		return jobSearchController;
	}

	/**
	 * @param jobSearchController the jobSearchController to set
	 */
	public void setJobSearchController(JobSearchController jobSearchController) {

		this.jobSearchController = jobSearchController;
	}

	/**
	 * @return the jobAdvertisementController
	 */
	public JobAdvertisementController getJobAdvertisementController() {

		return jobAdvertisementController;
	}

	/**
	 * @param jobAdvertisementController the jobAdvertisementController to set
	 */
	public void setJobAdvertisementController(JobAdvertisementController jobAdvertisementController) {

		this.jobAdvertisementController = jobAdvertisementController;
	}

	/**
	 * @return the mainframe
	 */
	public MainFrame getMainframe() {

		return mainframe;
	}

	/**
	 * @param mainframe the mainframe to set
	 */
	public void setMainframe(MainFrame mainframe) {

		this.mainframe = mainframe;
	}

	/**
	 * @return the instance
	 */
	public static MainController getInstance() {

		return instance;
	}

	/*
	 * public void startUseCase() {
	 * useCaseController = new UseCaseController(mainframe);
	 * useCaseController.startUseCase();
	 * }
	 */
	public void registerJobSeeker() {

		jobSeekerController.startRegisterJobSeeker();
	}

	public void startAddJobAd() {

		jobAdvertisementController.startAddJobAd();
	}

	public void searchJobAd() {

		jobSearchController.startSearchJob();
	}

	public void startTestingViewJobAd() {

		jobAdvertisementController.startJobAdDetails("1");
	}

	public void pendingProcessingJobResponses() {

	}

	public void showJobResponseListing() {

	}
}
